package handler

import (
	"New-lesson-part2/order_web/req"
	"New-lesson-part2/proto/pb"
	"github.com/gin-gonic/gin"
	"net/http"
)

func ProductListHandler(c *gin.Context) {
	c.JSON(http.StatusOK, gin.H{
		"msg": "ok",
	})

}
func AddHandler(c *gin.Context) {
	c.JSON(http.StatusOK, gin.H{
		"msg": "ok",
	})
}
func DetailHandler(c *gin.Context) {
	c.JSON(http.StatusOK, gin.H{
		"msg": "ok",
	})
}
func DeleteHandler(c *gin.Context) {
	c.JSON(http.StatusOK, gin.H{
		"msg": "ok",
	})
}

func UpdateHandler(c *gin.Context) {
	c.JSON(http.StatusOK, gin.H{
		"msg": "ok",
	})
}
func ConvertOrderReq2pb(req req.OrderReq) *pb.OrderItemReq {
	res := &pb.OrderItemReq{
		Id:        req.ID,
		AccountId: req.AccountId,
		Addr:      req.Addr,
		PostCode:  req.PostCode,
		Receiver:  req.Receiver,
		Mobile:    req.Mobile,
		PayType:   req.PayType,
	}
	return res
}
